const Controller = require('egg').Controller;

class HomeController extends Controller {
  async index() {
    this.ctx.body = 'Hello world';
  }
  async home() {
    // controller只负责接收和发送
    // 不负责复杂业务逻辑
    // 所有的业务逻辑都放到service
    const data = await this.ctx.service.home.home();
    this.ctx.body = data;
  }
}

module.exports = HomeController;